/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.games.epkb.entityClasses;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author plebani
 */
@Embeddable
public class SystemActionOnComponentPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "Id_SystemAction")
    private String idSystemAction;
    @Basic(optional = false)
    @Column(name = "Id_Component")
    private String idComponent;

    public SystemActionOnComponentPK() {
    }

    public SystemActionOnComponentPK(String idSystemAction, String idComponent) {
        this.idSystemAction = idSystemAction;
        this.idComponent = idComponent;
    }

    public String getIdSystemAction() {
        return idSystemAction;
    }

    public void setIdSystemAction(String idSystemAction) {
        this.idSystemAction = idSystemAction;
    }

    public String getIdComponent() {
        return idComponent;
    }

    public void setIdComponent(String idComponent) {
        this.idComponent = idComponent;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSystemAction != null ? idSystemAction.hashCode() : 0);
        hash += (idComponent != null ? idComponent.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SystemActionOnComponentPK)) {
            return false;
        }
        SystemActionOnComponentPK other = (SystemActionOnComponentPK) object;
        if ((this.idSystemAction == null && other.idSystemAction != null) || (this.idSystemAction != null && !this.idSystemAction.equals(other.idSystemAction))) {
            return false;
        }
        if ((this.idComponent == null && other.idComponent != null) || (this.idComponent != null && !this.idComponent.equals(other.idComponent))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "it.polimi.games.epkb.entityClasses.SystemActionOnComponentPK[ idSystemAction=" + idSystemAction + ", idComponent=" + idComponent + " ]";
    }
    
}
